#include<bits/stdc++.h>

using namespace std;

int main() {
    for (int n; cin >> n;) {
        vector<int> a = {1}; //1
        for (int y = 2; y <= n; y++) {
            for (int i = 0; i < a.size(); i++) {
                a[i] *= y;
            }
            int cs = 0;
            for (int i = 0; i < a.size(); i++) {
                int temp = a[i] + cs;
                cs = temp / 10;
                a[i] = temp % 10;
            }
            while (cs > 0) {
                a.push_back(cs % 10);
                cs /= 10;
            }
        }
        copy(a.rbegin(), a.rend(), ostream_iterator<int>(cout, ""));
        cout << endl;
    }
    return 0;
}